<template>
  <div>
    <ButtonBar  :buttons="buttons" ref="btnRef"></ButtonBar>
    <a-button @click="handleClick">设置</a-button>
  </div>
</template>
<script lang="ts" setup>
import { ButtonBar } from "/@/components";
import { ref } from "vue";
const btnRef = ref();
const buttons = [
  {
    type: "primary",
    title: "成功",
    style: "color:red",
    function: function () {
      // buttons[0].loading = true
      
    },
  },
  {
    type: "dashed",
    title: "失败",
    style: "color:#cccc",
    function: function () {
      console.log("222");
    },
  },
];
function handleClick() {
  btnRef.value.updateProps(1, { loading: true, style: "color:red" });
}

</script>
